<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // function getSum(num1, num2) {
    //   return num1 + num2
    // }
    // let num = getSum(+prompt('请输入第一个数:'), +prompt('请输入第二个数:'))
    // alert(`结果为${num}`)

    function getSum(x,y) {
      let res = x + y
      return res
    }
    let te = getSum(1,2)
    document.write(`两者的和是${te}`)
  </script>
</body>
</html>